/**
 * Customer数据传输对象
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.dto;


import com.sxf.crm.entity.Customer;
import com.sxf.crm.entity.CustomerDepartment;
import com.sxf.crm.entity.Department;
import com.sxf.crm.entity.Industry;
import com.sxf.crm.enums.CustomerSource;
import com.sxf.crm.enums.CustomerStage;
import com.sxf.crm.enums.CustomerStatus;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Set;

import org.springframework.beans.BeanUtils;


/**
 * 客户数据传输对象
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/6/1
 */
@Data
public class CustomerDTO {
    private Long id;
    private String name;
    private CustomerStage stage;
    private String stageLabel;
    private CustomerSource source;
    private String contactName;
    private String contactPhone;
    private String contactEmail;
    private String contactPosition;
    private String visitAddress;
    private String registerAddress;
    private CustomerStatus status;
    private String statusLabel;

    private Integer industryId;
    private String address;
    private String website;
    private String description;
    private Long createAt;
    private Long createUserId;
    private String creatorName;
    private Long updateAt;
    private Long updateUserId;
    private String updaterName;

    private String remark;
    private String businessLicense;
    private BigDecimal annualRevenue;
    private Integer employeeCount;


    public static CustomerDTO fromEntity(Customer customer) {
        if (customer == null) {
            return null;
        }

        CustomerDTO dto = new CustomerDTO();
        BeanUtils.copyProperties(customer, dto);
        return dto;
    }

}
